home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.undo;
-
- import java.io.Serializable;
-
- public class AbstractUndoableEdit implements UndoableEdit, Serializable {
- protected static final String UndoName = "Undo";
- protected static final String RedoName = "Redo";
- boolean hasBeenDone = true;
- boolean alive = true;
-
- public boolean addEdit(UndoableEdit var1) {
- return false;
- }
-
- public boolean canRedo() {
- return this.alive && !this.hasBeenDone;
- }
-
- public boolean canUndo() {
- return this.alive && this.hasBeenDone;
- }
-
- public void die() {
- this.alive = false;
- }
-
- public String getPresentationName() {
- return "";
- }
-
- public String getRedoPresentationName() {
- String var1 = this.getPresentationName();
- if (var1 != "") {
- var1 = "Redo " + var1;
- } else {
- var1 = "Redo";
- }
-
- return var1;
- }
-
- public String getUndoPresentationName() {
- String var1 = this.getPresentationName();
- if (var1 != "") {
- var1 = "Undo " + var1;
- } else {
- var1 = "Undo";
- }
-
- return var1;
- }
-
- public boolean isSignificant() {
- return true;
- }
-
- public void redo() throws CannotRedoException {
- if (!this.canRedo()) {
- throw new CannotRedoException();
- } else {
- this.hasBeenDone = true;
- }
- }
-
- public boolean replaceEdit(UndoableEdit var1) {
- return false;
- }
-
- public String toString() {
- return super.toString() + " hasBeenDone: " + this.hasBeenDone + " alive: " + this.alive;
- }
-
- public void undo() throws CannotUndoException {
- if (!this.canUndo()) {
- throw new CannotUndoException();
- } else {
- this.hasBeenDone = false;
- }
- }
- }
-